package com.traffic.constant;

import lombok.Getter;

/**
 * Created by IntelliJ IDEA.
 * User: KingRainGrey
 * Date: 2020/9/3
 */
@Getter
public enum Status {
    /**
     * 操作成功
     */
    OK(200, "请求成功"),
    /**
     * 其他错误
     */
    LOGIN_ERROR(201, "登录失败"),
    TOKEN_ERROR(202,"没有权限"),
    DATABASE_ERROR(203,"数据库错误"),
    PARAM_ERROR(204,"参数错误"),
    NOT_ERROR(205, "没有登录"),
    COMMON_ERROR(206, "请求失败"),
    SMS_TIMES_ERROR(207,"短信验证码请求次数达到上限"),
    SMS_WAIT_ERROR(208,"请求太过频繁"),
    ACCOUNT_NO_ERROR(209,"账户不存在"),
    AUTH_NO_ERROR(210,"权限不存在"),
    ACCOUNT_NO_THIS_AUTH(211,"账户下没有对应权限"),
    ROLE_NO_ERROR(212, "角色不存在"),
    PARAM_MISS(213, "缺少必须参数"),
    AUTH_ROLE_HAVE(214,"该角色下存在用户,无法直接删除"),
    SMS_CODE_MORE_TIME(215, "验证码已经过期"),
    SMS_CODE_ERROR(216,"验证码错误"),

    /**
     * 未知异常
     */
    UNKNOWN_ERROR(500, "服务器出错啦");
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 内容
     */
    private String message;

    Status(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
